<fieldset>
    <legend>
    <?php 
    if(isset($_GET['app_id'])){?>
    Cập nhật thông tin ứng dụng
    <?php }else{?>
    Thêm ứng dụng mới
    <?php }?>
</legend>
    <form name="frmData" id="frmData" action="<?php echo URL_BASE.'/admin/apps/saveData' ?>" method="POST" enctype="multipart/form-data">
        <?php
        if (isset($_GET['app_id'])) {
           $app=$this->app;
            ?>
            <input type="hidden" name="txtAppID" value="<?php echo $_GET['app_id']?>"/>
            <?php
        }
        ?>
        <p>
            <label>Tên ứng dụng:</label>
            <input type="text" placeholder="Name..." class="text-long required" name="txtTitle" value="<?php if (isset($_GET['app_id'])) echo $app->getTitle(); ?>"/>
        </p>
        <p>
            <label>Ảnh:</label>
            <?php if (isset($_GET['app_id'])) { ?>
                <img src="<?php echo URL_BASE . '/' . $app->getImages() ?>" width="100" height="100" alt="No Image"/>
            <?php } ?>
            <input type="file" name="images[]"/>
        </p>
        
        <p>
            <label>Mô tả:</label>
            <textarea rows="20" placeholder="Description..." cols="30" name="txtDes" class="required"><?php if (isset($_GET['app_id'])) echo $app->getDescription(); ?></textarea>
        </p>
        
        <p>
            <label>Phiên bản:</label>
            <input type="text" placeholder="Version..." class="text-long required" name="txtVersion" value="<?php if (isset($_GET['app_id'])) echo $app->getVersion(); ?>"/>
        </p>
        <p>
        <label>Yêu cầu phần cứng:</label>
            <input type="text" placeholder="Requirement..." class="text-long required" name="txtRequirement" value="<?php if (isset($_GET['app_id'])) echo $app->getRequirement(); ?>"/>
        </p>
        <p>
        <label>Chuyên mục:</label>
            <input type="text" placeholder="Version..." class="text-long required" name="txtVersion" value="<?php if (isset($_GET['app_id'])) echo $app->getVersion(); ?>"/>
        </p>
        <p>
        <label>Kích thước:</label>
            <input type="text" placeholder="Size..." class="text-long required" name="txtSize" value="<?php if (isset($_GET['app_id'])) echo $app->getSize(); ?>"/>
        </p>
        <p>
        <label>Đường dẫn:</label>
            <input type="text" placeholder="Link..." class="text-long required" name="txtLink" value="<?php if (isset($_GET['app_id'])) echo $app->getLink(); ?>"/>
        </p>
        <p>
            <label>Point:</label>
            <input type="text" placeholder="Price..." class="text-long required" name="txtPoint" value="<?php if (isset($_GET['app_id'])) echo $app->getPoint(); ?>"/>
        </p>
        <?php
        if (!isset($_GET['app_id'])||(isset($_GET['app_id'])&&($app->getStatus()==0))){
            
        ?>
        <label>Trạng thái</label>
            <select name="status">
                <option value="1">Đăng</option>
                <option value="0" selected>Chưa đăng</option>
            </select>
        <?php }?>
        <p>
            <br>
        <input type="submit" value="Cập nhật" name="submit"/>
    </form>
    <a href="<?php echo URL_BASE?>/admin/apps" class="btn">Quay lại</a>
</fieldset>
